﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Newtonsoft.Json;
using QuTouTiaoAssist.Util;

namespace QuTouTiaoAssist.Entity
{
    /// <summary>
    /// 用户信息
    /// </summary>
    public class QttMemberInfo
    {
        /// <summary>
        /// ID
        /// </summary>
        [JsonProperty("member_id")]
        public string MemberId;

        /// <summary>
        /// 手机号
        /// </summary>
        [JsonProperty("telephone")]
        public string MobileNumber;

        /// <summary>
        /// 昵称
        /// </summary>
        [JsonProperty("nickname")]
        public string NickName;

        /// <summary>
        /// 头像地址
        /// </summary>
        [JsonProperty("avatar")]
        public string AvatarUrl;

        /// <summary>
        /// 零钱余额
        /// </summary>
        [JsonProperty("balance")]
        public string Balance;

        /// <summary>
        /// 金币余额
        /// </summary>
        [JsonProperty("coin")]
        public int Coin;

        /// <summary>
        /// 邀请码
        /// </summary>
        [JsonProperty("invite_code")]
        public string InviteCode;

        /// <summary>
        /// 是否绑定微信，1是0否
        /// </summary>
        [JsonProperty("is_bind_wx")]
        public int IsBindWeiXin;

        /// <summary>
        /// 徒弟数
        /// </summary>
        [JsonProperty("pupil_num")]
        public int PupilNumber;

        /// <summary>
        /// 师傅ID
        /// </summary>
        [JsonProperty("teacher_id")]
        public string TeacherId;

        /// <summary>
        /// 是否为新手
        /// </summary>
        [JsonProperty("is_fresher")]
        public bool IsFresher;

        /// <summary>
        /// 生日
        /// </summary>
        [JsonProperty("birth")]
        public string Birth;

        /// <summary>
        /// 礼物通知
        /// </summary>
        [JsonProperty("gift_notice")]
        public QttGiftNotice GiftNotice;

        public DateTime? GetBirth()
        {
            if (OtherUtil.IsNullOrWhitespace(Birth))
                return null;
            return DateTime.Parse(Birth);
        }
    }
}
